package ModelLayer;

import java.util.*;

public class Person 
{
    private long id;
    private String name;
    private String address;
    private String postalCode;
    private String city;
    private String phone;
    static long runningAddrId;
    

    /**
     * Constructor of objects of class Person
     */
    public Person(String newName, String newAddress, String newPostalCode, String newCity, String newPhone)
    {
        runningAddrId++;
        id = runningAddrId;
        name = newName;
        address = newAddress;
        postalCode = newPostalCode;
        city = newCity;
        phone = newPhone;
    }
    
    /**
     * accersor and mutator methods
     */
    public long getId()
    {
        return id;   
    }
    
    public void setName(String newName)
    {
        name = newName;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setAddress(String newAddress)
    {
        address = newAddress;
    }
    
    public String getAddress()
    {
        return address;
    }
    
    public void setPostalCode(String newPostalCode)
    {
        postalCode = newPostalCode;
    }
    
    public String getPostalCode()
    {
        return postalCode;
    }
    
    public void setCity(String newCity)
    {
        city = newCity;
    }
        
    public String getCity()
    {
        return city;
    }
    
    public void setPhone(String newPhone)
    {
        phone = newPhone;
    }
    
    public String getPhone()
    {
        return phone;
    }
    
    public void updatePerson(String name, String address, String postalCode, String city, String phone)
    {
       setName(name);
       setAddress(address);
       setPostalCode(postalCode);
       setCity(city);
       setPhone(phone);
    }
    
    /**
     * prints the instances of the person
     */
    public void printPerson()
    {
        System.out.println("*****************************");
        System.out.println("ID: " + id);
        System.out.println("Name: " + name);
        System.out.println("Address: " + address);
        System.out.println("Postal code: " + postalCode);
        System.out.println("City: " + city);
        System.out.println("Phone: " + phone);
        System.out.println("*****************************");
    }
}